<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html rsf:id="html" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"/>
<style rsf:id="iconstyle" type="text/css">
</style>
<script rsf:id="scr=portal-matter" src="/library/js/headscripts.js"></script>
<link rsf:id="scr=portal-matter" href="/library/skin/tool_base.css" type="text/css" rel="stylesheet" media="all" />
<link rsf:id="scr=portal-matter" href="/library/skin/default-skin/tool.css" type="text/css" rel="stylesheet" media="all" />
<link type="text/css" href="/library/webjars/jquery-ui-themes/1.12.1/smoothness/jquery-ui.min.css" rel="stylesheet" />	
<title rsf:id="msg=simplepage.showitem"></title>

<style type="text/css">
	#outer{
		min-height:325px;
	}
	html>body #outer{height:auto}
        .Mrphs-toolTitleNav{margin-top:-10px !important}
        span.siteTitle{background-color:red;display:none !important;}
        .Mrphs-toolTitleNav .Mrphs-toolTitleNav__button_container {
           top: 12px !important;
        }
</style>

<script type="module" src="/webcomponents/bundles/rubric-association-requirements.js"></script>
<script>

// need a delay to allow dynamic things like inserting the html editor
function resizeiframe1() {
    setTimeout("resizeiframe()",1000);
}

function resizeiframe() {

var iframe = document.getElementById('iframe1');
var newsize = 350;
try {
// workarounds for differing implemtations in several browsers
var doc = (iframe.contentWindow || iframe.contentDocument);
if (doc.document) doc = doc.document;
newsize = doc.body.offsetHeight;
} catch (err) {
}

var winh = window.top.innerHeight - 250;
if (winh > newsize)
   newsize = winh;

if (newsize > 32760) newsize = 32760;

iframe.style.height = (newsize + 50) + 'px';
setMainFrameHeight(window.name);

}

</script>

</head>

<body rsf:id="scr=sakai-body">
<a href="#" rsf:id="redirect-link" id="redirect-link"></a>
<script>includeLatestJQuery('ShowItem.html');</script>
<script rsf:id="redirect">
  location.href = document.getElementById("redirect-link").href;
</script>
<script src="/library/js/jquery/cluetip/1.2.10/jquery.cluetip.min.js"></script>
<link rel="stylesheet" href="/library/js/jquery/cluetip/1.2.10/css/jquery.cluetip.css" type="text/css" />

<script>
$(function() {
         if ($(".showItemMorpheus").size() != 0) {
         // inline, move action (next/prev buttons) to top area
           $(".itemHeader").show();
	   // move hierarchy to top area -- resources and applications
           if ($(".crumb-item").size() > 0) {
	       // inline, resource mode
	       $(".Mrphs-siteHierarchy").append($(".title .crumb-item a,.title .crumb-item span").slice(1));
	       // with title at the top, don't need a header for resources
	       // don't do this to samigo view
               if ($(".returnwarning, iframe[src*='samigo-app'").size() === 0) {
                   $(".itemHeader").addClass("itemHeader-resource");
		   $(".title span").text('');
               } else { // for tests, etc need the return warning, but kill the title
                   $(".itemTitle .title").addClass("instruction title-instruction");
                   $(".title .crumb-item").hide();
               }               
           } else {
             // call tool from picker
                   $(".itemTitle .title").addClass("instruction title-instruction");
           }
	   $(".Mrphs-siteHierarchy").children().wrapAll('<div class="hierarchyWrap" />');
	   $(".Mrphs-siteHierarchy").append($(".action").children().first());
           $(".Mrphs-siteHierarchy .nextprev").removeClass("usebutton returnheader");
         }
        
	if (!(navigator.userAgent.indexOf("Firefox/2.") > 0)) {
	    $('.usebutton').button({text:true});
	} else {
	    // fake it; can't seem to get rid of underline though
	    $('.usebutton').css('border', '1px solid black').css('padding', '1px 4px').css('color', 'black');
	}
	// don't do this twice. if portal is loaded portal will do it
        if(typeof portal == 'undefined')
	$('a.tool-directurl').cluetip({
		local: true,
		    arrows: true,
		    cluetipClass: 'jtip',
		    sticky: true,
		    cursor: 'pointer',
		    activation: 'click',
		    closePosition: 'title',
		    closeText: '<span class="bi bi-x" aria-hidden="true"></span>'
		    });
});

function toggleShortUrlOutput(defaultUrl, checkbox, textbox) {
    if($(checkbox).is(':checked')) {
	$.ajax({
		url:'/direct/url/shorten?path='+encodeURI(defaultUrl),
		    success: function(shortUrl) {
		    $('.'+textbox).val(shortUrl);
		}
	    });
    } else {
	$('.'+textbox).val(defaultUrl);
    }
}

</script>

	<div rsf:id="portletBody" class="portletBody" id="outer">
		
		
		<div rsf:id="hiddenAlert" class="ui-widget">
			<div class="sak-banner-error below-link-help">
				<div rsf:id="hidden-text" ></div>
			</div>
		</div>
		
		<div rsf:id="refreshAlert" class="ui-widget">
			<div class="instruction" title="Some items on this page are required.  Refreshing will update the icons next to them to reflect their current state.">
				<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
				<span rsf:id="msg=simplepage.refresh_prompt"></span> <strong><a role="button" href="#" rsf:id="refreshLink"><span rsf:id="msg=simplepage.refresh"></span></a></strong> <span rsf:id="msg=simplepage.update_icons"></span></p>
			</div>
		</div>
		
		<br rsf:id="breakAfterWarnings" />

        <div rsf:id="nav" role="navigation" class="neoPortletTitleWrap itemHeader">
            <div class="portletTitle itemTitle">
                <div class="title">
                    <a role="button" href="#" rsf:id="resetbutton2" class="title-tools reset reload Mrphs-toolTitleNav__link Mrphs-toolTitleNav__link--reset"><img rsf:id="resetimage2" src="/library/image/transparent.gif"/></a>
                    <span rsf:id="crumb:" class="crumb-item"><a style="background:none" href="#" rsf:id="crumb-link" class="crumb-link"></a><span rsf:id="crumb-follow" class="lessons-siteHierarchy-title"></span><span rsf:id="crumb-separator" class="Mrphs-hierarchy--separator"><i class="fa fa-lg fa-angle-right"></i></span></span>
                    <span class="returnheader nextprev"><a role="button" style="background:none; width:auto" href="#" class="usebutton nextprev returnmsg" rsf:id="return"></a></span>
                    <span rsf:id="returnwarning" class="returnwarning sak-banner-warn"></span>
                </div>
                <div class="action itemAction">
                    
                    <span class="nextprev buttonset ui-buttonset"><a role="button" style="background:none" href="#" rsf:id="prev" class="nextprev nextbutton ui-button ui-widget ui-state-default ui-button-text-only ui-corner-left ui-button-text">prev</a><a role="button" href="#" rsf:id="next" style="background:none" class="nextprev nextbutton ui-button ui-widget ui-state-default ui-button-text-only ui-corner-right ui-button-text">next</a></span>
                    <a role="button" aria-haspopup="dialog" aria-controls="direct-dialog" href="#" rsf:id="directurl" id="directurl" class="title-tools tool-directurl Mrphs-toolTitleNav__link link--directurl">
                      <img rsf:id="directimage" src="/library/image/transparent.gif"/>
	            </a>
		    <div rsf:id="directurl-div" id="direct-dialog" role="dialog" class="portlet title-tools direct-url-wrap Mrphs-directUrl Mrphs-directUrl__dropDown">
		      <input rsf:id="directurl-input" type="checkbox" class="portlet title-tools short-url"/>
		      <span rsf:id="directurl-shorten">Short URL</span>
		      <textarea rsf:id="directurl-textarea" class="portlet title-tools"></textarea>
		    </div>
                    <a role="button" href="#" rsf:id="helpbutton2" target="_blank" class="title-tools help Mrphs-toolTitleNav__link Mrphs-toolTitleNav__link--help-popup"><img rsf:id="helpimage2" src="/library/image/transparent.gif" /><span rsf:id="helpnewwindow2" class="lb-offscreen"></span></a>

                </div>
            <div style="clear:both"> </div>
            </div>
        </div>

		<iframe rsf:id="iframe1" role="main"
			name="iframe1"
                        id="iframe1"
			height="350"
                        onload="resizeiframe1()"
			width="100%"
			frameborder="0"
			marginwidth="0"
			marginheight="0"
			allowfullscreen="true"
			webkitallowfullscreen="true"
			mozallowfullscreen="true"
			scrolling="auto">
		</iframe>
		<script>
//<![CDATA[
		window.addEventListener('message', function(e) {
			try {
				var message = e.data;
				if ( typeof message == 'string' ) message = JSON.parse(e.data);
				var idval = 'iframe1';
				if ( message.subject == 'lti.frameResize' && typeof(message.height) == 'number' ) {
					var height = message.height;
					document.getElementById(idval).height = height;
					console.debug('Reveived lti.frameResize height='+height);
				}
				else if ( message.subject == 'lti.pageRefresh' ) {
                                        location.reload(true);
				}
			} catch (error) {
				console.debug('lti.frameResize of '+idval+' failed height='+height);
				console.debug(e.data);
			}
		});
//]]>
		</script>

	</div>	
</body>
</html>